//-------------------------------------------------------------------------------------
//
// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows.
//
// Licensed under the BSD license, see LICENSE in JGE root for details.
// 
// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) <jhkhui@gmail.com>
// 
//-------------------------------------------------------------------------------------

#ifndef _GAMEAPP_H_
#define _GAMEAPP_H_

#include <JApp.h>
#include "GameMenu.h"

class hgeParticleSystem;
class JTTFont;
class JResourceManager;
class JSample;

enum GameMode
{
	GM_Logo = 0,
	GM_SelectLanguage = 1,
	GM_MainMenu = 2,
	GM_Game = 3,
	GM_Pause = 4,
	GM_Win = 5,
	GM_About = 6,
};


class GameApp:	public JApp
{
// ResourceManager
private:
	JResourceManager* m_pResourceManager;
	JTTFont* m_pFont;
	JTTFont* m_pSmallFont;

	JSample* m_pModeTileEffect;
	//hgeParticleSystem*	m_pMovingParticleSys;

	GameMenu selectLanguageMenu;
	GameMenu mainMenu;
	GameMenu pauseMenu;

	int m_menuOffset;
	int m_menuDirection;
	float mTimer;

	GameMode CurrentGameMode;
	GameMode PrevGameMode;


public:
	GameApp();
	virtual ~GameApp();
	virtual void Create();
	virtual void Destroy();
	virtual void Update();
	virtual void Render();
	virtual void Pause();
	virtual void Resume();


protected:
	void RenderLogo();
	void RenderSelectLanguage();
	void RenderGameMode();
	void RenderMenu(GameMenu& menu);
	void RenderAbout();
	void RenderWin();

	void ProcessMenuOffset();
};

#endif

